package com.guohu.service;

import com.bean.*;
import com.guohu.mapper.GuoHuMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GuoHuService {
    @Autowired
    GuoHuMapper guoHuMapper;
    public List<WmsTCustomer> get(){
       return guoHuMapper.get();
    }

    public List<WmsTCustomer> getOutUser(){
        return guoHuMapper.getOutUser();
    }

    //根据customer id获得用户拥有的物品信息

    public List<WmsTBillDetails> getInformation(String custid){
        return guoHuMapper.getInformation(custid);
    }
    //获取到id
    public String getCustomerid(String billid){
        return guoHuMapper.getCustomerid(billid);
    }
    //获取到name
    public String getCustmername(String billid){
        return guoHuMapper.getCustmername(billid);
    }

    //获得托盘个数
    public int getTray(String custmoerId){
        return guoHuMapper.getTray(custmoerId);
    }

    //查询库存费用
    public Double getResultNum(String customerId){
        return guoHuMapper.getResultNum(customerId);
    }

    //获取其他费用

    public Double getOtherNum(String customerId){
        return guoHuMapper.getOtherNum(customerId);
    }

    //插入wms_t_transfer

    public void insertRtan(WmsTTransfer wmsTTransfer){
        guoHuMapper.insertRtan(wmsTTransfer);
    }

    //根据id获取所有detailsID
    public List<String> getdetailsID(String customerID){
        return  guoHuMapper.getdetailsID(customerID);
    }

    //结算时商品的件数
    public int getProNum(String customerId){
        return guoHuMapper.getProNum(customerId);
    }

    //插入wms_t_trans_details

    public void insertDetails(WmsTTransDetails wmsTTransDetails){
        guoHuMapper.insertDetails(wmsTTransDetails);
    }

    //动态sql查询
    public List<WmsTTransfer> getWmsInfor(WmsTTransfer wmsTTransfer){
        return guoHuMapper.getWmsInfor(wmsTTransfer);
    }

    //bill表插入卖家数据
    public void insertBill(WmsTBill wmsTBill){
        guoHuMapper.insertBill(wmsTBill);
    }

    //bill表插入卖家买家数据
    public void insertBill1(WmsTBill wmsTBill){
        guoHuMapper.insertBill1(wmsTBill);
    }

    //查出卖家出库后的billid
    public List<String> getOutUserBillid(String customerid){
        return guoHuMapper.getOutUserBillid(customerid);
    }

    //更改出库后卖家的billisdel为1

    public void updateBillisDel(String billid){
        guoHuMapper.updateBillisDel(billid);
    }

    //更改出库后卖家的WmsTBillDetails表中的billisdel为1
    public void updateDetailsDel(String billid){
        guoHuMapper.updateDetailsDel(billid);
    }
}
